package com.weitu.contractor.service.impl;

import com.weitu.contractor.entity.SafeProductCertHistory;
import com.weitu.contractor.entity.SafeProductCertHistoryCriteria;
import com.weitu.contractor.mapper.SafeProductCertHistoryMapper;
import com.weitu.contractor.service.SafeProductCertHistoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SafeProductCertHistoryServiceImpl implements SafeProductCertHistoryService {
    private final SafeProductCertHistoryMapper safeProductCertHistoryMapper;

    private static final Logger logger = LoggerFactory.getLogger(SafeProductCertHistoryServiceImpl.class);

    @Autowired
    public SafeProductCertHistoryServiceImpl(SafeProductCertHistoryMapper safeProductCertHistoryMapper) {
        this.safeProductCertHistoryMapper = safeProductCertHistoryMapper;
    }

    @Override
    public int countByCriteria(SafeProductCertHistoryCriteria example) {
        int count = this.safeProductCertHistoryMapper.countByCriteria(example);
        logger.debug("count: {}", count);
        return count;
    }

    @Override
    public SafeProductCertHistory selectByPrimaryKey(String id) {
        return this.safeProductCertHistoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<SafeProductCertHistory> selectByCriteria(SafeProductCertHistoryCriteria example) {
        return this.safeProductCertHistoryMapper.selectByCriteria(example);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String id) {
        return this.safeProductCertHistoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(SafeProductCertHistory record) {
        return this.safeProductCertHistoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByCriteriaSelective(SafeProductCertHistory record, SafeProductCertHistoryCriteria example) {
        return this.safeProductCertHistoryMapper.updateByCriteriaSelective(record, example);
    }

    @Override
    @Transactional
    public int insertSelective(SafeProductCertHistory record) {
        return this.safeProductCertHistoryMapper.insertSelective(record);
    }
}